﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Project_Origin
{
    public partial class PO_ModeSelect_Menu : Form
    {
        public PO_ModeSelect_Menu()
        {
            InitializeComponent();
        }
        //定义鼠标点位
        private Point mousePoint = new Point();

        //计时器，实现慢关
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (this.Opacity >= 0.3)
                this.Opacity -= 0.3;
            else
            {
                PO_Timer1.Stop();
                this.Close();
                Environment.Exit(Environment.ExitCode);
            }
        }

        //窗口移动组件
        private void PO_ModeSelect_Menu_MouseDown(object sender, MouseEventArgs e)
        {
            this.mousePoint.X = e.X;
            this.mousePoint.Y = e.Y;
        }

        private void PO_ModeSelect_Menu_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                this.Top = Control.MousePosition.Y - mousePoint.Y + 13;
                this.Left = Control.MousePosition.X - mousePoint.X + 13;
            }
        }

        //退出按键
        private void PO_Button_Exit_Click(object sender, EventArgs e)
        {
            PO_Timer1.Start();
        }

        //最小化按键
        private void PO_MixNum_Button_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;
        }


        //返回功能按键
        private void PO_Button_Back_Click(object sender, EventArgs e)
        {
            this.Dispose();
            this.Close();
            PO_MainMenu pO_MainMenu = new PO_MainMenu();
            pO_MainMenu.Show();
        }

        //经典模式
        private void PO_Button_Classical_Mode_Click(object sender, EventArgs e)
        {
            PO_Select_Difficult pO_Select_Difficult = new PO_Select_Difficult();
            pO_Select_Difficult.Show();
            this.Dispose();
            this.Close();
        }

        //街机模式
        private void PO_Button_Score_Mode_Click(object sender, EventArgs e)
        {
            PO_Arcade_Mode pO_Arcade_Mode = new PO_Arcade_Mode();
            pO_Arcade_Mode.Show();
            this.Dispose();
            this.Close();
        }
    }
}
